package dd.model;

import client.ServerAccess;
import dd.view.CreateForm;
import dd.view.ModeratorAddChoices;
import dd.view.SignInScreen;
import dd.view.addChoiceScreen;
import dd.view.addEdgeFrame;

public class Model {
	/**
	 * the place record all local information, I use it as a global thing
	 * save many screens for further use for example for dispose a screen
	 * save the ServerAccess to send a message
	 */
	
	Event event;
	SignInScreen sins;
	CreateForm cf;
	addChoiceScreen acs;
	ModeratorAddChoices mac;
	addEdgeFrame aef;
	
	static Model instance = null;
	/** Connection to server. */
	ServerAccess access;
	
	Model () {
		
	}
	
	public static Model getInstance() {
		if (instance == null) {
			instance = new Model();
		}
		
		return instance;
	}
	
	public void setEvent (Event e) {
		this.event = e;
	}

	public Event getEvent() {
		return event;
	}
	/** Return the server access object. */
	public ServerAccess getServerAccess() {
		return access;
	}
	
	/** Application needs to know the access object for contacting server. */
	public void setServerAccess(ServerAccess sa) {
		this.access = sa;
	}
	public void setSignInScreen(SignInScreen sis){
		this.sins = sis;
	}
	public SignInScreen getSignInScreen(){
		return sins;
	}
	public void setCreateForm(CreateForm cff){
		this.cf = cff;
	}
	public CreateForm getCreateForm(){
		return cf;
	}
	public void setaddChoiceScreen(addChoiceScreen ac){
		this.acs = ac;
	}
	public addChoiceScreen getaddAddChoiceScreen(){
		return acs;
	}
	public void setmac(ModeratorAddChoices macc){
		this.mac = macc;
	}
	public ModeratorAddChoices getmac(){
		return mac;
	}
	public addEdgeFrame getaef(){
		return aef;
	}
	public void setaef(addEdgeFrame aef){
		this.aef = aef;
	}
}
